<!--# layout("/common/layout.html",{"jsBase":"/js/cms/siteFunds/"}){ -->

<form class="layui-form " id="updateForm">
    <!--# include("commonedit.html"){} -->
    <layui:personnelsubmitButtons id="updateButton" />
</form>
<!--#} -->
<script>
layui.use(['edit'], function(){
    var siteFundsEdit = layui.edit
    siteFundsEdit.init();

    var form = layui.form;
    form.on('select(workstationName)', function (data) {
        $.ajax({
            url: "/cms/siteFunds/findSite.do",
            data:{id:data.value},
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $("#approvalNumber").val(data.approvalNumber);
                $("#timeConstruction").val(new Date(data.timeConstruction).format("yyyy-MM-dd"));
            }
        })
        if(data.value==""){
            $("#approvalNumber").val("");
            $("#timeConstruction").val("");
        }
    });

    form.on('select(fundingProjects)', function (data) {
        var value = data.value;
        if (value == 1 || value == 2) {
            $("#declarationAmount").val(150000.00);
        } else if (value == 3 || value == 4){
            $("#declarationAmount").val(100000.00);
        }
    });
});


</script>
